import java.util.Scanner;

// 小易的打怪升级之路

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) {
            int n = in.nextInt(); // 怪兽数目.
            int able = in.nextInt(); // 初始能力.

            while (n > 0) {
                int m = in.nextInt(); // 防御力
                if(able > m)
                    able += m;
                else {
                    // 找最大公约数
                    int k = find(able, m);
                    able += k;
                }
                --n;
            }
            System.out.println(able);

        }
    }

    private static int find(int able, int m) {
        while (m % able != 0) {
            int tmp = m % able;
            m = able;
            able = tmp;
        }
        return able;
    }
}